/**
 * JAVACC DEMO 1.0
 * @copy right dwusoft company All rights reserved. 
 * @Package com.apache.bid.service.adminplugins  
 */
package com.apache.bid.service.adminplugins;

import java.util.Map;

import com.apache.api.vo.ParamsVo;
import com.apache.api.vo.ResultEntity;
import com.apache.bid.common.BidCommonUtil;
import com.apache.bid.common.Constant;
import com.apache.bid.common.WbdToolsUtil;
import com.apache.rpc.client.RpcProtoclClient;

/**
 * description:  保存标的
 * @author Hou Dayu 创建时间：2016-3-25  
 * 
 */
public class SaveItemPluginImpl extends com.apache.bid.service.plugins.SaveItemPluginImpl {

	public Object execute(ParamsVo param) throws Exception {
		ResultEntity entity = null;
		if (Constant.getInstance().ifWriteDatabase()) {
			entity = (ResultEntity) super.execute(param);
		} else {
			Map map = WbdToolsUtil.getInstance().toMapDelNull(param.getObj());
			map.putAll(param.getParams());
			entity = RpcProtoclClient.getInstance().doService("wbdCacheService", "saveItem", map,
					BidCommonUtil.getInstance().getInterfaceRegister("", ""));
			log.info("result=" + entity.getResult() + ";msg=" + entity.getMessage());
		}
		return entity;
	}
}
